package com.dimong.www.loan.app;

import android.text.TextUtils;

import com.dimong.loan.sdk.utils.Utils;

/**
 * Created by wuligang on 2018/5/14.
 */

public class ProductInfo {
    private String productId;
    private String channelId;
    private static ProductInfo productInfo;

    public static ProductInfo getInstance() {
        if (productInfo == null) {
            productInfo = new ProductInfo();
        }
        return productInfo;
    }

    public String getProductId() {
        if (TextUtils.isEmpty(productId)) {
            int temp = Utils.getManifestMetaDataInt(MyApplication.getAppContext(), "PRODUCT_ID");
            if (temp == -1) {
                productId = "";
            } else {
                productId = temp + "";
            }
        }
        return productId;
    }

    public String getChannelId() {
        if (TextUtils.isEmpty(channelId)) {
            int temp = Utils.getManifestMetaDataInt(MyApplication.getAppContext(), "CHANNEL_ID");
            if (temp == -1) {
                channelId = "";
            } else {
                channelId = temp + "";
            }
        }
        return channelId;
    }
}
